﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TipResponsFormat
{
    public class TipResponse{
 
        public static String FormatTheResponse(double result, double BillTotal,double rateIn,  int Persons)
        {
            double rate;
            double dPersons = (double)Persons;
            if (rateIn >= 1)
                rate = rateIn / 100;
            else
                rate = rateIn;

          string resultString;
            if(Persons>1)
                resultString = "Each person will pay " + result + "$ in tip, and the total bill will be " + (BillTotal + BillTotal * rate) + "$";
            else
                resultString = "You will pay " + result + "$ in tip, and the total bill will be " + (BillTotal + BillTotal * rate) + "$";
            return resultString;
        }
    }
}
